//求和功能相关配置
// eslint-disable-next-line no-unused-vars
export default {
    namespaced: true,
    actions: {
        jiaOdd: function (context, val) {
            // console.log('jiaOdd:',context,val)
            if (context.state.sum % 2) {
                context.commit('JIA', val)
            }
        },
        jiaWait: function (context, val) {
            setTimeout(() => {
                context.commit('JIA', val)
            }, 500)
        }
    },
    mutations: {
        'JIA': function (state, val) {
            state.sum += val
        },
        'JIAN': function (state, val) {
            state.sum -= val
        },
    },
    state: {
        sum: 0,
        school: '尚硅谷',
        subject: '前端',
    },
    getters: {
        bigSum: function (state) {
            return state.sum * 10
        }
    },

}